TEST_ROOT=../src
CC=gcc
CFLAG=-g -Wall
OBJECT=testtools_report
OBJECT_CMP=testtools_cmp
COMM_ROOT=../../../../dist/dev/include/apmcomm
COMM_LIB=../../../../dist/dev/lib/apm_comm_c_1.0.a
INCLUDES=-I. -I$(COMM_ROOT) -I/usr/local/include/libxml2

all: clean testtools_report testtools_cmp

testtools_report: $(TEST_ROOT)/testtools.c \
         $(TEST_ROOT)/testtools_send.c \
         $(TEST_ROOT)/testtools_receive.c

	@$(CC) $(CFLAG) $^ -o $(OBJECT) $(COMM_LIB) `xml2-config --cflags --libs` -lgthread-2.0 $(INCLUDES) -lz -lm -ldl -lzlog -luuid

testtools_cmp: $(TEST_ROOT)/testtools_compare.c

	@$(CC) $(CFLAG) $^ -o $(OBJECT_CMP) $(COMM_LIB) `xml2-config --cflags --libs` -lgthread-2.0 $(INCLUDES) -lz -lm -ldl -lzlog -luuid -ljson-c


clean:
	@rm -f $(OBJECT) $(OBJECT_CMP)

install:
	cp $(OBJECT) ../bin/$(OBJECT);cp $(OBJECT_CMP) ../bin/$(OBJECT_CMP);cp testtools.sh ../bin/testtools.sh
